{%TEMPLATE->struct/head%}
{%TEMPLATE->struct/menu%}
<h2>Cracker Binary '[[binaryType.getTypeName()]]'</h2>
{%TEMPLATE->struct/messages%}
<div class="card">
  <div class="table-responsive">
    <table class="table table-bordered">
		  <tr>
			  <th>Binary ID</th>
			  <th>Version</th>
			  <th>Binary Name</th>
			  <th>Download URL</th>
			  <th>Action</th>
		  </tr>
		  {{FOREACH binary;[[binaries]]}}
			  <tr>
				  <td>[[binary.getId()]]</td>
				  <td><code>[[binary.getVersion()]]</code></td>
				  <td>[[htmlentities([[binary.getBinaryName()]], ENT_QUOTES, "UTF-8")]]</td>
				  <td>[[htmlentities([[binary.getDownloadUrl()]], ENT_QUOTES, "UTF-8")]]</td>
				  <td>
					  {{IF [[accessControl.hasPermission([[$DAccessControl::CRACKER_BINARY_ACCESS]])]]}}
						  <form class="float-right mx-1" action="crackers.php?id=[[binaryType.getId()]]" method="POST" onSubmit="if (!confirm('Really delete binary [[binary.getVersion()]]?')) return false;">
							  <input type="hidden" name="action" value="[[$DCrackerBinaryAction::DELETE_BINARY]]">
							  <input type="hidden" name="binaryId" value="[[binary.getId()]]">
							  <input type="hidden" name="csrf" value="[[csrf]]">
                <button type="submit" class='btn btn-danger' data-toggle="tooltip" data-placement="top" title="Delete"><i class="fas fa-trash" aria-hidden="true"></i></button>
						  </form>
						  <div class="float-right mx-1">
							  <a class='btn btn-primary' href="crackers.php?edit=true&id=[[binary.getId()]]" data-toggle="tooltip" data-placement="top" title="Edit"><i class="fas fa-edit" aria-hidden="true"></i></a>
						  </div>
					  {{ENDIF}}
				  </td>
			  </tr>
		  {{ENDFOREACH}}
	  </table>
  </div>
</div>
{%TEMPLATE->struct/foot%}